package com.eastfair.common.service;

import com.eastfair.boot.service.SuperService;
import com.eastfair.common.dto.AuthCodeUserDTO;
import com.eastfair.common.entity.AuthCodeUser;
import com.eastfair.common.vo.AuthCodeUserVO;
import com.eastfair.core.base.R;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 服务商对外授权码与用户关系
 * </p>
 *
 * @author dqq
 * @date 2023-02-14
 */
public interface AuthCodeUserService extends SuperService<AuthCodeUser> {

    /**
     * 查询授权码用户关系列表.
     *
     * @param authCodeUserDTO the auth code dto
     * @return the list
     */
    List<AuthCodeUser> listAuthCodeUser(AuthCodeUserDTO authCodeUserDTO);

    /**
     * 授权用户ID查询授权关系.
     *
     * @param authUserId the auth user id
     * @return the list
     */
    List<AuthCodeUser> listByAuthUserId(String authUserId);

    /**
     * 授权码查询授权用户列表.
     *
     * @param authCode the auth code
     * @return the list
     */
    List<AuthCodeUserVO> listVOByAuthCode(String authCode);

    /**
     * 用户ID，授权码查询授权关系.
     *
     * @param authUserId the auth user id
     * @param authCode   the auth code
     * @return the by auth user id and auth code
     */
    AuthCodeUser getByAuthUserIdAndAuthCode(String authUserId, String authCode);

    /**
     * 外部用户与授权码绑定.
     *
     * @param authCodeUserDTO the auth code user dto
     * @return the boolean
     */
    R<Boolean> bindAuthCodeUser(AuthCodeUserDTO authCodeUserDTO);

    /**
     * 保存用户授权码关系.
     *
     * @param authCodeUserDTO the auth code user dto
     * @return the boolean
     */
    boolean saveAuthCodeUser(AuthCodeUserDTO authCodeUserDTO);

    /**
     * 更新用户授权码关系.
     *
     * @param authCodeUserDTO the auth code user dto
     * @return the boolean
     */
    boolean updateAuthCodeUser(AuthCodeUserDTO authCodeUserDTO);

    /**
     * 更新最后登录时间.
     *
     * @param authCodeUserId the auth code user id
     * @param authCode       the exhibition manage id
     * @return the boolean
     */
    boolean updateLastLoginTime(String authCodeUserId, String authCode);

    /**
     * 授权码删除授权码用户关系.
     *
     * @param authCode the auth code
     * @return the boolean
     */
    boolean removeByAuthCode(List<String> authCode);

    /**
     * 根据用户ID与授权码删除授权关系.
     *
     * @param authCode   the auth code
     * @param authUserId the auth user id
     * @return the boolean
     */
    boolean removeByAuthCodeAndAuthUserId(String authCode, String authUserId);
}
